package com.aplink.generic.constant.type;

public enum SharePreferenceType {

    DEVICE_ID("DeviceID", "PREF_REGISTRATION_ID"),
    TOKEN("Token", "PREF_TOKEN"),
    USERNAME("Username", "USER_LOGIN");

    public static SharePreferenceType get(final String key) {
        for (final SharePreferenceType preferenceType : SharePreferenceType
                .values()) {
            if (preferenceType.mKey.equalsIgnoreCase(key)) {
                return preferenceType;
            }
        }
        return null;
    }

    private String mKey;

    private String mValue;

    private SharePreferenceType(final String key, final String value) {
        this.mKey = key;
        this.mValue = value;
    }

    public String getKey() {
        return this.mKey;
    }

    public String getValue() {
        return this.mValue;
    }

    public void setKey(final String key) {
        this.mKey = key;
    }

    public void setValue(final String value) {
        this.mValue = value;
    }

    @Override
    public String toString() {
        return this.mValue;
    }
}
